# !/usr/bin/env python
# -*-coding:utf-8 -*-

"""
# File       : logout_view.py
# Time       ：2023/10/21 15:38
# Author     ：author name
# version    ：python 3.10
# Description：登出视图
"""
from apis.token import token_ns
from public.api_utils.api_decorator import handle_api_error
from public.base_response import generate_response, MarshalModel
from public.base_view import AbstractView

logout_marshal = MarshalModel('logout', token_ns)


class LogoutView(AbstractView):
    url = '/logout'

    @handle_api_error()
    @token_ns.marshal_with(logout_marshal.create_response())
    def post(self):
        """退出登录"""
        return generate_response('登出成功')
